package com.ruoyi.storage.dataBackhaul.service.impl;

import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.storage.bicycle.domain.Bicycle;
import com.ruoyi.storage.bicycle.mapper.BicycleMapper;
import com.ruoyi.storage.dataBackhaul.domain.DataBackhaulOrder;
import com.ruoyi.storage.dataBackhaul.mapper.DataBackhaulMapper;
import com.ruoyi.storage.dataBackhaul.service.DataBackhaulService;
import com.ruoyi.storage.fitting.domain.FittingValue;
import com.ruoyi.storage.fitting.mapper.FittingMapper;
import com.ruoyi.storage.orderWarehousing.domain.BicycleOrder;
import com.ruoyi.storage.orderWarehousing.mapper.BicycleOrderMapper;
import com.ruoyi.storage.packageWeighing.domain.Package;
import com.ruoyi.storage.packageWeighing.mapper.PackageMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.*;

/**
 * 其他入库单Service业务层处理
 * 
 * @author zzx
 * @date 2024-02-06
 */
@Service
public class DataBackhaulServiceImpl implements DataBackhaulService
{

    @Autowired
    private BicycleMapper bicycleMapper;
    @Autowired
    private FittingMapper fittingMapper;


    /**
     * 查询其他入库单列表
     * 
     * @param bicycle 其他入库单
     * @return 其他入库单
     */
    @Override
    public List<Bicycle> selectBicycleOrderList(Bicycle bicycle) {
        List<Bicycle> bicycles = bicycleMapper.selectDataBackhaulList(bicycle);
        for (Bicycle bicycleListVo : bicycles) {
            List<FittingValue> fittingValues=fittingMapper.selectFittingValueByBicycle(bicycleListVo.getBicycleId());
            Map<String, String> map = new HashMap<>();
            for (FittingValue fittingValue:fittingValues) {
                map.put(fittingValue.getFittingFabienName(),fittingValue.getFitting());
            }
            bicycleListVo.setMap(map);
        }
        return bicycles;
    }

    @Override
    public AjaxResult syncBackhaulBybicycleIds(String[] bicycleIds) {
        return null;
    }


}
